
#ifndef __ROOT_PAGE_H__
#define __ROOT_PAGE_H__

#include "sys_port.h"
#include "root.h"

#include "dev_dwled.h"
#include "dev_swled.h"
#include "dev_mc.h"
#include "dev_oc.h"
#include "dev_jc.h"
#include "dev_purifier.h"
#include "dev_washer.h"

typedef struct {

    int         scroll_flag;
    lv_coord_t  x_s;
    lv_coord_t  x_e;

    lv_coord_t  index;

    lv_obj_t*   root_page;
    lv_group_t* root_group;

    midea_collection_view* collection_content;

    lv_timer_t* touch_timer;

}ui_root_page_t;

page_vtable_t* lv_page_root_create(void);

int root_page_del_byindex(int index);
int root_page_delete_all_device(void);


int root_page_add_swled(ui_dev_swled_t* swled);
int root_page_add_dwled(ui_dev_dwled_t* dwled);
int root_page_add_devmc(ui_dev_mc_t* mc);
int root_page_add_devoc(ui_dev_oc_t* oc);
int root_page_add_devjc(ui_dev_jc_t* jc);
int root_page_add_devpuri(ui_dev_purifier_t* puri);

int root_page_disable_scroll(void);
int root_page_enable_scroll(void);

int root_page_switch_next(void);

#endif
